package com.sskj.mine.ui.activity;

import android.webkit.WebView;
import android.widget.LinearLayout;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.just.agentweb.AgentWeb;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseActivity;
import com.sskj.mine.R2;
import com.sskj.mine.presenter.BasePresenter;
import com.sskj.mine.R;

import butterknife.BindView;

@Route(path = RConfig.MINE_CONTANT_KF)//联系客服
public class MineContantKFActivity extends BaseActivity<BasePresenter> {

    @BindView(R2.id.webView)
    WebView webView;
    AgentWeb mAgentWeb;

    @Override
    protected int getLayoutResId() {
        return R.layout.mine_activity_contant_kf;
    }

    @Override
    public BasePresenter getPresenter() {
        return new BasePresenter();
    }

    @Override
    protected void initView() {
        super.initView();
        setTitle("联系客服");
        String url = "file:///android_asset/services_cn.html";
//        if ("english".equals(BaseApplication.getLANGUAGE())) {
//            url = "file:///android_asset/services_en.html";
//        } else {
//            url = "file:///android_asset/services_cn.html";
//        }
        mAgentWeb = AgentWeb.with(this)
                .setAgentWebParent(webView, new LinearLayout.LayoutParams(-1, -1))
                .useDefaultIndicator()
                .createAgentWeb()
                .ready()
                .go(url);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mAgentWeb.destroy();
    }
}
